package com.wuzhi.shop.product.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.List;

import com.fasterxml.jackson.annotation.JacksonInject;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;

/**
 *
 * @author gonglize
 * @email 2567007734@gmail.com
 * @date 2022-03-09 18:26:53
 */
@Data
@TableName("pms_category")
public class CategoryEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 */
	@TableId
	private Long catId;
	/**
	 */
	@NotBlank
	private String name;
	/**
	 */
	private Long parentCid;
	/**
	 */
	private Integer catLevel;
	/**
	 * 逻辑删除字段，0-不显示 1-显示
	 */
	@TableLogic(value = "1",delval = "0")
	private Integer showStatus;
	/**
	 */
	private Integer sort;
	/**
	 */
	private String icon;
	/**
	 */
	private String productUnit;
	/**
	 */
	private Integer productCount;

//	自定义一个子分类,在数据库中不存在;当这个数据不能有空
	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	@TableField(exist = false)
	private List<CategoryEntity> children;

}
